home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 23
/
AMIGAplus Sonderheft 23 (2000)(Falke)(DE)[!].iso
/
Updates
/
AddOns
/
WormWars
/
Source
/
system.h
< prev
next >
Wrap
C/C++ Source or Header
|
1999-11-08
|
58KB
|
3,247 lines
/* $Filename: WormWars/Source/system.h $
* $VER: WormWars 4.1 (1.6.99) $
* $Description: Header file for system.c $
*
* © Copyright 1993-1999 James R. Jacobs of Amigan Software.
* Freely distributable.
*
* Beta version.
#INCLUDES -------------------------------------------------------------- */
#include <exec/exec.h>
#include <intuition/intuition.h>
#include <intuition/gadgetclass.h> // STRINGA_ReplaceMode
#include <libraries/asl.h> // ASL_FileRequest
#include <libraries/gadtools.h> // struct StringInfo
#include <devices/gameport.h> // struct GamePortTrigger
#include <devices/input.h>
#include <devices/inputevent.h>
#include <dos/dosextens.h> // struct Process
#include <graphics/displayinfo.h> // PAL_MONITOR_ID, etc.
#include <exec/types.h>
#include <exec/memory.h>
#include <devices/audio.h>
#include <dos/dos.h>
#include <libraries/iffparse.h>
#include <stdio.h> // FILE, printf()
#include <stdlib.h> // EXIT_SUCCESS, EXIT_FAILURE
#include "diff.h"
#include "same.h"
#include "libproto.h"
// say() arguments (hidden messages)
#define FIRSTLISA "Lisa is gorgeous!"
#define SECONDLISA "My beloved! :-)"
// statistics text
#define STATSINGLE "Single"
#define STATTRIPLE "Triple"
#define STATQUINTUPLE "Quint."
#define STATSEPTUPLE "Sept. "
#define STATFAST "Fast "
#define STATNORMAL "Normal"
#define STATSLOW "Slow "
#define STATVERYFAST "V.Fast"
#define STATVERYSLOW "V.Slow"
#define ALTJUMP 5
#define LIFEMODULO 1000
/* #DEFINES ---------------------------------------------------------------
miscellaneous */
#define ABOUTLINES 6
#define ABOUTSHADOW DARKBLUE
#define ABOUTSHINE BLUE
#define ANIMDELAY 40000L
#define SEGMENTS 17
/* constant strings
screen/window titles */
#define ASLOPENHAIL "Open Fieldset"
#define ASLSAVEHAIL "Save Fieldset"
#define TITLEBAR "Worm Wars 4.1"
// pathnames, etc.
#define EMERGENCYNAME "Error.fset"
#define MEDMODULE "WormWars.MED"
#define PATTERN "(#?.fset)"
// alerts (fatal errors) used multiple times
#define ALERTTIMERVALUE "\0\20\20Worm Wars: Can't allocate timer value structure!\0"
#define ALERTMENUCREATE "\0\20\20Worm Wars: Can't create menus!\0"
#define ALERTMENULAYOUT "\0\20\20Worm Wars: Can't lay out menus!\0"
#define NUMKEYS 29
#define QUEUELIMIT 15
#define UNDERLINEOFFSET (46 + STARTYPIXEL)
// object descriptions
#define FIRSTDESCX 120 // these X/Ys are in pixels
#define SECONDDESCX (SCREENXPIXEL - FIRSTDESCX)
#define DESCY 3
// pseudo-gadgets
#define GADGETX -3
#define GOLDGADGET (FIELDY / 2 - 11)
#define SILVERGADGET (FIELDY / 2 - 8)
#define EMPTYGADGET (FIELDY / 2 - 5)
#define WOODGADGET (FIELDY / 2 - 2)
#define STONEGADGET (FIELDY / 2 + 1)
#define ONEGADGET (FIELDY / 2 + 4)
#define TWOGADGET (FIELDY / 2 + 7)
#define STARTGADGET (FIELDY / 2 + 10)
// menus
#define PROJECTSTART 0 // array offsets of menu headers
#define TOOLSSTART 9
#define LEVELSTART 12
#define MN_PROJECT 0
#define MN_TOOLS 1
#define MN_LEVEL 2
#define IN_NEW 0
#define IN_OPEN 1
#define IN_SAVE 2
#define IN_SAVEAS 3
#define IN_ABOUT 5
#define IN_QUIT 7
#define IN_TS 0
#define IN_FE 1
#define IN_INSERT 0
#define IN_DELETE 1
#define IN_ERASE 2
#define IN_APPEND 3
// window dimensions
#define ABOUTXPIXEL 312
#define ABOUTYPIXEL 106
// ARRAYS -----------------------------------------------------------------
UWORD chip CustomPointer[] =
{ 0x0000, 0x0000, // reserved
0xF000, 0xF800, // 1st row 1st plane, 1st row 2nd plane
0xF000, 0x8800, // 2nd row 1st plane, 2nd row 2nd plane
0xF000, 0x8800, // 3rd row 1st plane, 3rd row 2nd plane
0xF000, 0x8800, // 4th row 1st plane, 4th row 2nd plane
0xF000, 0x8800, // 5th row 1st plane, 5th row 2nd plane
0x8000, 0xF800, // 6th row 1st plane, 6th row 2nd plane
0x0000, 0x0000 // reserved
};
STRPTR objectdesc[LASTOBJECT + 1] =
{ "AFFIXER: Stops protectors rotating.",
"AMMO: 1-6 bullets.",
"ARMOUR: Immune to most damage.",
"BIAS: Rules changes in your favour.",
"BOMB: An explosion.",
"BONUS: Random letter.",
"GROWER: Enlarges silver and gold.",
"ICE: Freezes everything except you.",
"LIFE: 1-6 lives.",
"MISSILE: A guided missile.",
"MULTIPLIER: More points.",
"NITRO: Improved movement.",
"POWER: Thicker bullets.",
"PROTECTOR: An orbiting companion.",
"SLAYER: Smart bomb.",
"SWITCHER: Changes tail colours.",
"HEALER: 100/200 lives.",
"TONGUE: Convert tails.",
"TREASURE: Treasure level."
};
UWORD chip ImageData[ARRAYSIZE + 1][SQUAREY * 4] =
{ // This definition must precede definition of Image...
{ 0x7F00, // AFFIXER
0xFF80,
0xFF80,
0xFF80,
0x7F00,
0x3E00,
0x7F00,
0x9C80,
0xFF80,
0xDD80,
0x6300,
0x3E00,
0x7F00,
0x9C80,
0xFF80,
0xDD80,
0x6300,
0x3E00,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000 },
{ 0x0800, // AMMO
0x0000,
0x0800,
0x0000,
0x0800,
0x0000,
0x0000,
0x0800,
0x0000,
0x0800,
0x0000,
0x1C00,
0x0800,
0x0800,
0x0800,
0x0800,
0x0800,
0x1C00,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000 },
{ 0x8080, // ARMOUR
0xC180,
0xF780,
0xFF80,
0x9C80,
0xFF80,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x8080,
0xC180,
0xF780,
0x9C80,
0x9C80,
0xFF80,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000 },
{ 0x0180, // BIAS
0x0180,
0x0300,
0xC600,
0x6C00,
0x3800,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0180,
0x0180,
0x0300,
0xC600,
0x6C00,
0x3800,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000 },
{ 0x0600, // BOMB
0x0000,
0x1C00,
0x6300,
0x4100,
0x3E00,
0x0200,
0x0800,
0x1C00,
0x6300,
0x4100,
0x3E00,
0x0600,
0x0000,
0x0000,
0x1C00,
0x3E00,
0x0000,
0x0200,
0x0800,
0x0000,
0x0000,
0x0000,
0x0000 },
{ 0x0000, // BONUS
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0180,
0x0180,
0x0300,
0xC600,
0x6C00,
0x3800,
0x0180,
0x0180,
0x0300,
0xC600,
0x6C00,
0x3800,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000 },
{ 0x3F00, // GROWER
0x4800,
0x3E00,
0x0900,
0x7E00,
0x0800,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x3700,
0x4000,
0x3600,
0x0100,
0x7600,
0x0000 },
{ 0x0000, // ICE
0x3E00,
0x7C00,
0x7C00,
0x7C00,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x3F00,
0x0300,
0x0300,
0x0200,
0x0000,
0x0000,
0x3F00,
0x0300,
0x0300,
0x0200,
0x0000 },
{ 0x007F, // LIFE
0x637F,
0x777F,
0x1C7F,
0x087F,
0x007F,
0x6300,
0xF780,
0xFF80,
0x7F00,
0x1C00,
0x0800,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x637F,
0xF7FF,
0xFFFF,
0x7F7F,
0x1C7F,
0x087F },
{ 0x0000, // MISSILE
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x8780,
0xCC00,
0x7F00,
0x0980,
0x1880,
0xF080,
0x8780,
0xCC00,
0x7F00,
0x0980,
0x1880,
0xF080,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000 },
{ 0x0F00, // MULTIPLIER
0x9080,
0x6100,
0x9200,
0x0400,
0x0F80,
0x0000,
0x9000,
0x6000,
0x9000,
0x0000,
0x0000,
0x0F00,
0x9080,
0x6100,
0x9200,
0x0400,
0x0F80,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000 },
{ 0x0800, // NITRO
0x1C00,
0x2A00,
0x0800,
0x1C00,
0x0800,
0x0000,
0x0000,
0x0000,
0x0000,
0x1400,
0x1400,
0x0000,
0x0000,
0x1400,
0x1400,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000 },
{ 0x0800, // POWER
0x0E00,
0x0F80,
0x7800,
0x3800,
0x0800,
0x0000,
0x3000,
0xF000,
0x0700,
0x0600,
0x0000,
0x0800,
0x3E00,
0xFF80,
0x7F00,
0x3E00,
0x0800,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000 },
{ 0x0000, // PROTECTOR
0x6300,
0x0000,
0x2200,
0x1C00,
0x0000,
0x7F00,
0x9C80,
0xFF80,
0xDD80,
0x6300,
0x3E00,
0x7F00,
0x9C80,
0xFF80,
0xDD80,
0x6300,
0x3E00,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000 },
{ 0x4880, // SLAYER
0x0000,
0x8000,
0x0080,
0x0000,
0x8900,
0x4880,
0x0000,
0x9C00,
0x1C80,
0x0000,
0x8900,
0x4880,
0x0000,
0x9C00,
0x1C80,
0x0000,
0x8900,